home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_03 / kamradt / delay.h < prev    next >
C/C++ Source or Header  |  1994-02-07  |  718b  |  40 lines

  1. class BMOJoin;
  2.  
  3. class BMOIteratorImp {
  4. public:
  5.   BMOIteratorImp() 
  6.   { 
  7.     itsJoinPtr = NULL; 
  8.   }
  9.   ~BMOIteratorImp() 
  10.   { 
  11.     delete itsJoinPtr; 
  12.   }
  13.   int Search(char *str)
  14.   {
  15.     return 
  16.       GetJoinPointer()->Search(str);
  17.   }
  18.   void Disconnect()
  19.   {
  20.     delete itsJoinPtr;
  21.     itsJoinPtr = NULL;
  22.   }
  23. private:
  24. // this is actually split apart
  25. // (see Figure 4.)      
  26.   BMOJoin *GetJoinPointer()
  27.   {                             
  28.     if(itsJoinPtr)
  29.       return itsJoinPtr;
  30.     itsJoinPtr = new 
  31.       BMOJoin(itsStoredParameters);
  32.     if(itsJoinPtr == NULL)
  33. // for now throw is just an inline 
  34. // for exit()
  35.       throw(ErrNoMem);          
  36.     return itsJoinPtr;
  37.   }
  38. };
  39.  
  40.